# -*- coding: utf-8 -*-
import scrapy
import re

class RrSpider(scrapy.Spider):
    name = 'rr'
    allowed_domains = ['renren.com']
    start_urls = ['http://www.renren.com/327550029/profile']


    def start_requests(self):
        cookies = 'anonymid=jsvgs9smq5gsid; _r01_=1; jebe_key=c35d6f2e-cd54-41e4-9e7a-c4f1bf60249e%7Cd8c61104c1c7286d23e11dacc8309369%7C1551773052285%7C1%7C1551773052573; _de=9C625340FAE1D253247380B22A94C474696BF75400CE19CC; ln_uact=894028891@qq.com; ln_hurl=http://head.xiaonei.com/photos/0/0/men_main.gif; depovince=ZGQT; jebecookies=c3d96643-c36a-48eb-b7dc-3f5ba118fb4a|||||; JSESSIONID=abcUKHfH-wVqLdmAVLDNw; ick_login=cf1cc3a4-c90c-4129-a9b2-b49ed11b1c4b; p=aa5611c6a65302ad16224797ee0bb0459; first_login_flag=1; t=abea3d1656879ad37c90df3890c8cfc69; societyguester=abea3d1656879ad37c90df3890c8cfc69; id=969950769; xnsid=2268d95e; loginfrom=syshome; jebe_key=c35d6f2e-cd54-41e4-9e7a-c4f1bf60249e%7Cd8c61104c1c7286d23e11dacc8309369%7C1551773052285%7C1%7C1554200867489; wp_fold=0'
        cookies_dict = {i.split('=')[0]: i.split('=')[1] for i in cookies.split('; ')}
        yield scrapy.Request(
            self.start_urls[0],
            cookies=cookies_dict,
            callback=self.parse
        )

    def parse(self, response):
        result = re.findall('毛兆军', response.text)
        print(result)
